﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace SystemAnalizer.Models
{
    public class MatrixModels:SystemModel
    {
        public MatrixModels(int systemsize)
            : base(systemsize)
        {     
        }
        public MatrixModels(int number_of_discretes,int systemsize)
            : base(number_of_discretes,systemsize)
        {
            
        }
        public static void VisualMatrixMaker(int matrixsize,Grid matrixgrid)
        {
            matrixgrid.Height = 22 * matrixsize;
            matrixgrid.Width = 60 * matrixsize;
            for(int i = 0;i<matrixsize; i++)
            {
                RowDefinition row = new RowDefinition();
                row.MinHeight = 22;
                matrixgrid.RowDefinitions.Add(row);
                for(int j=0;j<matrixsize;j++)
                {
                    ColumnDefinition column = new ColumnDefinition();
                    column.MinWidth = 60;
                    matrixgrid.ColumnDefinitions.Add(column);
                    TextBox valuetxt = new TextBox();
                    valuetxt.TextChanged += (o, e) =>
                    {
                        valuetxt.ToolTip = valuetxt.Text;
                    };
                    
                    Grid.SetRow(valuetxt,i);
                    Grid.SetColumn(valuetxt, j);
                    matrixgrid.Children.Add(valuetxt);
                }
            }
        }
    }
}
